package com.gm.commonlib.base.baseBean;

import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.List;

public class BasePageListData<TData> extends BaseResp implements Serializable {

    @SerializedName("total")
    private int total;
    @SerializedName("totalPage")
    private int totalPage;

    PageInfo pageInfo;

    public int getTotalPage() {
        return totalPage;
    }

    public void setTotalPage(int totalPage) {
        this.totalPage = totalPage;
    }

    public PageInfo getPageInfo() {
        if (total>0){
            pageInfo=new PageInfo();
            pageInfo.setTotalPages(totalPage);
            pageInfo.setPageNum(10);
        }
        return pageInfo;
    }

    public void setPageInfo(PageInfo pageInfo) {
        this.pageInfo = pageInfo;
    }

    public int getTotal() {
        return total;
    }

    public void setTotal(int total) {
        this.total = total;
    }


    @SerializedName(value = "items", alternate ={"templates"})
    private List<TData> datas;//承载数据

    public List<TData> getDatas() {
        return datas;
    }

    public void setDatas(List<TData> datas) {
        this.datas = datas;
    }
}
